package cn.uniqueinfo.dp.service.impl;

import cn.uniqueinfo.dp.mapper.FormButtonMapper;
import cn.uniqueinfo.dp.service.IFormButtonService;
import cn.uniqueinfo.dp.service.base.BaseServiceImpl;
import cn.uniqueinfo.dp.vo.FormButtonVO;
import cn.uniqueinfo.dp.vo.RoleVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:朱元勋
 * @mail:395910063@qq.com
 * @date:2019-01-24 15:27:47
 * @description: 业务表单按钮设置
 */
@Service
public class FormButtonServiceImpl extends BaseServiceImpl<FormButtonVO>
        implements IFormButtonService {
    private FormButtonMapper mapper;

    public FormButtonServiceImpl(FormButtonMapper mapper) {
        this.mapper = mapper;
        this.baseMapper = mapper;
    }

    @Override
    public Integer deleteByFormName(String formName) {
        return this.mapper.deleteByFormName(formName);
    }

    /** 查询指定业务表单标识对应的按钮 */
    @Override
    public List<FormButtonVO> findButtonsByFormName(String formName) {
        FormButtonVO itemVO = new FormButtonVO();
        itemVO.setFormName(formName);
        return this.findAll(itemVO);
    }

    @Override
    public List<FormButtonVO> findButtons(String formName, List<RoleVO> list) {
        return this.mapper.findButtons(formName, list);
    }
}
